package tech.aistar.corejava.day06.HomeWork;

/**
 * Created by 李雨昂 on 2019/7/23.
 */
public class Test {
    public static void main(String[] args){
        //强制转换看运行时类型!!!
        SavingAccount sa1 = new SavingAccount();
        Account acc1 = new Account();
        //CreditAccount acc3 = (CreditAccount) acc1;
        Account acc2 = new CreditAccount();
        CreditAccount acc4 = (CreditAccount) acc2;

        //SavingAccount acc5 = (SavingAccount)acc1;

        System.out.print(acc1 instanceof CreditAccount);
        System.out.print(acc2 instanceof CreditAccount);
        //System.out.print(acc3 instanceof CreditAccount);
        System.out.print(acc4 instanceof CreditAccount);
        System.out.print(acc2 instanceof Account);//true
    }
}
